﻿@{
    ViewBag.Title = (ViewBag.source == 0 ? "预约申请" : ViewBag.source == 2 ? "我的病例" : "邀请助手");
}

@model zqdn.Web.ViewModels.HosCenter.MyCaseViewModel

<div class="wrap">
    <div class="pat-appointment-page common-list">
        @{var viewmodel = ViewBag.myappointobj;}
        @{var mycase = ViewBag.mycase;}

        <div class="list-data">
            @Html.Hidden("mycase", (zqdn.Models.Hospital.Case)mycase)
            @Html.Hidden("source", (int)ViewBag.source)
            <ul>
                <li class="items" id="left">
                    <div>
                        <img class="list-left-img" src="~/content/images/appoint-icon.png" alt="我的预约">
                    </div>
                </li>
                <li class="items" id="center">
                    <div class="nocenter" style="padding-top: 9px;">
                        <p class="title">@viewmodel.OperationName</p>
                        <p class="user-message">
                            <span class="m2 status1">手术时间：</span>
                            <span class="m3">@viewmodel.TimeGap.ToShortDateString()</span>
                        </p>
                    </div>
                </li>
                <li class="items" id="right"></li>
            </ul>
        </div>
        <br />
        @using (Html.BeginForm("MyCase", "HosCenter", FormMethod.Post, new { id = "myform", @class = "form" }))
        {
            @Html.Hidden("OperationID", (int)viewmodel.OperationID)
            @Html.Hidden("AppointID", (int)viewmodel.ID)
            <div class="form-data" style="border-bottom: 1px solid #AFB6BE;padding-bottom:5px;">
                <label>&nbsp;<i class="fa fa-medkit icon-large"></i>&nbsp;病例信息</label>
            </div>
            <div class="form-data">
                <label>患者手机号码:</label>
                @Html.TextBoxFor(o => o.Mobile, new { @class = "form-control required", placeholder = "患者手机号码", Value = (mycase == null ? "" : mycase.Mobile) })
            </div>

            <div class="form-data">
                <label>病例标题:</label>
                @Html.TextBoxFor(o => o.Title, new { @class = "form-control required", placeholder = "病例标题", Value = (mycase == null ? "" : mycase.Title) })
            </div>

            <div class="form-data">
                <label>病情描述:</label>
                @Html.TextBoxFor(o => o.Desc, new { @class = "form-control required", placeholder = "病情描述", Value = (mycase == null ? "" : mycase.Desc) })
            </div>
            <div class="form-data">
                <label>具体表现:</label>
                @Html.TextAreaFor(o => o.Content, new { @class = "form-control required", placeholder = "具体表现" })
                <input type="hidden" value="@(mycase == null ? "" : mycase.Content) " id="areacontent" />
            </div>

            <section class="form-data">
                <button type="submit" class="submit-btn" style="display:none;">添&nbsp;&nbsp;加</button>
                @if (ViewBag.AssistName == null)
                {
                    <button type="button" class="submit-btn" style="display:none;">邀请助手</button>
                }
                <br />
                @if (ViewBag.AssistName != null) { 
                <div class="list-data">
                    <div class="form-data" style="border-bottom: 1px solid #AFB6BE;padding-bottom:5px;">
                        <label>&nbsp;<i class="fa fa-medkit icon-large"></i>&nbsp;助手信息</label>
                    </div>
                    <ul>
                        <li class="items" id="left">
                            <div>
                                <img class="list-left-img" src="~/content/images/doc-assist.png" alt="助手信息">
                            </div>
                        </li>
                        <li class="items" id="center">
                            <div class="nocenter">
                                <p class="title">@ViewBag.AssistName</p>
                                <p class="user-message">
                                    <span class="m1"></span>
                                    <span class="m3">@ViewBag.AssistHosName</span>
                                </p>
                                <p class="view-message">
                                    <span class="m1"></span>
                                    <span class="m2">擅长</span>
                                    <span class="m3">@ViewBag.AssistDomin</span>
                                </p>
                            </div>
                        </li>
                    </ul>
                </div>
                }
            </section>

        }
        <br />
        <p class="notice">添加患者或其家属手机号之后，邀请其使用该手机号注册平台并支付手术定金。</p>

    </div>
</div>


@section scripts
{
    <script src="~/Content/js/jquery.validate/jquery.validate.min.js"></script>

    <script>
        $(function () {
            if ($("#source").val() == 0) {
                if ($("#mycase").val() == "") {
                    $(".submit-btn[type='submit']").show();
                }
                $(".notice").show();

            } else {
                $(".submit-btn[type='button']").show();
                $(".notice").hide();
                $(".submit-btn[type='button']").on("click", function () {
                    location.href = "/DocCenter/InviteAssists/?oid=" + $("#OperationID").val() + "";  ///邀请助手
                });
            }

            $("#Content").html($("#areacontent").val());

        });
    </script>
}